package jp.sourceforge.akjrcp.text_douga.rcp;



import jp.sourceforge.akjrcp.ffmpeg.FFMpegCodecs;

import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;


public class TextDougaPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {

    public static final String VIDEO_FPS="textdouga.video_fps"; //$NON-NLS-1$
    public static final String VIDEO_SIZE="textdouga.video_size"; //$NON-NLS-1$
    public static final String VIDEO_FPS_OTHER="textdouga.video_fps.other"; //$NON-NLS-1$
    public static final String VIDEO_SIZE_OTHER="textdouga.video_size.other"; //$NON-NLS-1$

    public static final String USE_HIGHSPEED="textdouga.use_high_speed";
	public TextDougaPage() {
		super(GRID);
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
		setDescription(Messages.getString("textdouga.page_description")); //$NON-NLS-1$
		
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		addField(new BooleanFieldEditor(USE_HIGHSPEED,Messages.getString("textdouga.use_high_speed"),getFieldEditorParent())); //$NON-NLS-1$
		
		
		addField(new RadioGroupFieldEditor(
				VIDEO_SIZE,
				Messages.getString("textdouga.video_size"), // //$NON-NLS-1$
				4,
				new String[][] { 
				{ Messages.getString("textdouga.size_640_480"), FFMpegCodecs.SIZE_640_480 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("textdouga.size_512_384"), FFMpegCodecs.SIZE_512_384 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("textdouga.size_320_240"), FFMpegCodecs.SIZE_320_240 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("textdouga.size_other"), VIDEO_SIZE_OTHER }, //$NON-NLS-1$ //$NON-NLS-2$
			}, getFieldEditorParent()));
		addField(new StringFieldEditor(VIDEO_SIZE_OTHER,Messages.getString("textdouga.size_other_value"),getFieldEditorParent())); //$NON-NLS-1$
		
		addField(new RadioGroupFieldEditor(
				VIDEO_FPS,
				Messages.getString("textdouga.video_fps"), // //$NON-NLS-1$
				4,
				new String[][] { 
				{ Messages.getString("textdouga.fps_30"), FFMpegCodecs.FPS_30 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("textdouga.fps_2997"), FFMpegCodecs.FPS_2997 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("textdouga.fps_15"), FFMpegCodecs.FPS_15 }, //$NON-NLS-1$ //$NON-NLS-2$
				{ Messages.getString("textdouga.fps_other"), VIDEO_FPS_OTHER }, //$NON-NLS-1$ //$NON-NLS-2$
			}, getFieldEditorParent()));
    	addField(new StringFieldEditor(VIDEO_FPS_OTHER,Messages.getString("textdouga.fps_value"),getFieldEditorParent())); //$NON-NLS-1$
    	
    	
    	
        }

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
